package com.diaohw.module.system.mapper;

import cn.hutool.core.util.StrUtil;
import com.diaohw.module.system.obj.entity.LoginLog;
import com.diaohw.module.system.obj.query.LoginLogQuery;
import com.diaohw.module.system.obj.tables.LoginLogDef;
import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * 用户登录日志 映射层。
 *
 * @author D-Hw
 * @since 2024-11-15 18:22:15
 */
@Mapper
public interface LoginLogMapper extends BaseMapper<LoginLog> {


    static QueryWrapper createWrapper(LoginLogQuery query){
       QueryWrapper wrapper = QueryWrapper.create();
       wrapper.and(LoginLogDef.LOGIN_LOG.ACCOUNT_ID.eq(query.getAccountId()).when(StrUtil.isNotBlank(query.getAccountId())));
       return wrapper;
   }
}
